
#include <liblog.hpp>

void funcA(int level);
void funcB(int level);

void funcB(int level)
{
    LOG_ENTER_FUNCTION("funcB(int)");
    if (level < 0)
    {
        LOG_MESSAGE("finish all layer output call");
        return ;
    }
    
    funcA(level-1);
    LOG_LEAVE_FUNCTION();
}

void funcA(int level)
{
    LOG_ENTER_FUNCTION("funcA(int)");
    if (level < 0)
    {
        LOG_MESSAGE("finish all layer output call");
        return ;
    }
    
    funcB(level-1);
    LOG_LEAVE_FUNCTION();
}

int main()
{
    CLog * pLog = CLog::instance();
    pLog->setDebug(true);
    CConsoleLog clog;
    pLog->registerLogDevice(&clog);
    CFileLog flog("test_file_log");
    pLog->registerLogDevice(&flog);

    LOG_DEBUG("Test debug log");
    LOG_ERROR("Test Error");
    funcA(10);

    return 0;
}

